The Best JavaScript Compressor!

You've found it - the best JavaScript Compressor available! Don't agree? Prove us wrong! If another compressor even comes close to our accuracy and compression ratio we'd like to hear about it.

JavaScript Compactors

Most of the JavaScript "compressors" out there just remove comments and whitespace. If you're lucky they'll shorten your local variable names. If you're really lucky they'll do it in a way that doesn't break your JavaScript.

JavaScript Compressors

The difference between a compactor and compressor is that the output from a compressor requires the resulting JavaScript code to be self decompressing. There are a few real compressors out there - most of them based on packer by Dean Edwards. Dean's script is very popular because it does a great job at reducing the size of JavaScript files. It's been the most highly recommended JavaScript compressor for quite a while.

Raising The Bar

ScriptDiet takes JavaScript to the next level. We run your script through our JavaScript Compactor to remove unnecessary comments and whitespace, and to shorten local variable names. Next we run the compacted code through our compressor and add in the decompressor. The process is much more thorough and therefore slower than most other compactors and compressors out there but we think it's worth the wait.

Try It, You'll Like It!

Compress any script you'd like (up to 60K before compression). If the compressed script doesn't behave exactly the same as the uncompressed script send us a copy of your uncompressed script and a page to test it with.

Note

To obtain such high compression ratios we use ISO-8859-1 characters that aren't in ASCII's limited 127 character set. When you include the compressed scripts in your HTML you must specify the charset to avoid unexpected results. Your include should look something like this:
<script src="myscript.js" type="text/javascript" charset="ISO-8859-1"></script>

Update

JavaScript files compressed prior to January 1, 2007 may not work with Safari. It seems that in addition to the standard ISO-8859-1 control characters 128-159, Safari doesn't like characters 160-191.